package com.yunxin.admin.system.domain.model.role;

import com.yunxin.core.admin.domain.AdminUser;

import java.util.Collection;
import java.util.List;

/**
 * @author zero°
 * @since 2023-07-11
 */
public interface RoleRepository {

    /**
     * 保存或更新角色
     * @param role role
     * @return boolean
     */
    boolean saveOrUpdate(Role role);

    /**
     * 根据id集合删除
     * @param ids ids
     * @return boolean
     */
    boolean removeByIdList(Collection<Long> ids);

    /**
     * 根据id更新角色状态
     * @param id id
     * @param status status
     * @return boolean
     */
    boolean updateStatus(Long id, Integer status);

    List<AdminUser> userListByRoleCode(String code,Integer teamId);

    List<AdminUser> getUserList(String code,List<Integer> teamIds);

    List<AdminUser> telephoneListBySalesmanId(String code,List<Integer> userIds,Integer teamId);

    List<Long> getUserRoles(Long id);

}
